
<?php $__env->startSection('title', '管理员列表'); ?>

<?php $__env->startSection('css'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header">
                    <form class="pull-left search-bar" method="post" action="<?php echo e(url('admin/admin/index')); ?>">
                        <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>"/>
                        <div class="col-xs-3 m-t-10">
                            <div class="input-group">
                                <span class="input-group-addon" id="basic-addon1">用户名</span>
                                <input type="text" class="form-control" name="user_name" placeholder="请输入用户名" aria-describedby="basic-addon1" value="<?php if(!empty($params['user_name'])){ ?><?php echo e($params['user_name']); ?><?php }?>">
                            </div>
                        </div>
                        <div class="col-xs-3 m-t-10">
                            <div class="input-group">
                                <span class="input-group-addon" id="basic-addon1">姓名</span>
                                <input type="text" class="form-control" name="true_name" placeholder="请输入姓名" aria-describedby="basic-addon1" value="<?php if(!empty($params['true_name'])){ ?><?php echo e($params['true_name']); ?><?php }?>">
                            </div>
                        </div>
                        <div class="col-xs-3 m-t-10">
                            <div class="input-group">
                                <span class="input-group-addon" id="basic-addon1">联系电话</span>
                                <input type="text" class="form-control" name="phone" placeholder="请输入联系电话" aria-describedby="basic-addon1" value="<?php if(!empty($params['phone'])){ ?><?php echo e($params['phone']); ?><?php }?>">
                            </div>
                        </div>
                        <div class="col-xs-3 m-t-10 pull-left">
                            <div class="input-group">
                                <button class="btn btn-info btn-w-xs m-r-10" type="submit">查询</button>
                                <button class="btn btn-secondary btn-w-xs m-r-10 reset-btn" type="button">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="card-toolbar clearfix">
                    <?php if(in_array('admin_add',Session::get('role_menu_action'))){ ?>
                    <div class="toolbar-btn-action">
                        <a class="btn btn-primary m-r-5" href="<?php echo e(url('admin/admin/add')); ?>"><i class="mdi mdi-plus"></i> 新增</a>
                    </div>
                    <?php } ?>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-striped">
                            <thead>
                            <tr>
                                <th width="50px">
                                    <label class="lyear-checkbox checkbox-primary">
                                        <input type="checkbox" id="check-all"><span></span>
                                    </label>
                                </th>
                                <th width="10%">用户名</th>
                                <th width="10%">姓名</th>
                                <th width="10%">联系电话</th>
                                <th width="10%">角色名称</th>
                                <th width="20%">登录ip</th>
                                <th width="20%">登录时间</th>
                                <th width="20%">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if(count($list) > 0): ?>
                                <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=>$v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>
                                            <label class="lyear-checkbox checkbox-primary">
                                                <input type="checkbox" name="ids[]" value="<?php echo e($v->id); ?>"><span></span>
                                            </label>
                                        </td>
                                        <td><?php echo e($v->admin_name); ?></td>
                                        <td><?php echo e($v->true_name); ?></td>
                                        <td><?php echo e($v->phone); ?></td>
                                        <td><?php echo $role_list[$v->role_id];?></td>
                                        <td>
                                            <?php echo !empty($v->login_ip) ? $v->login_ip : '';?>
                                        </td>
                                        <td>
                                            <?php echo !empty($v->login_time) ? date('Y-m-d H:i:s',$v->login_time) : '';?>
                                        </td>
                                        <td>
                                            <div class="btn-group">
                                                <?php if($v->id != 1): ?>
                                                    <?php if(in_array('admin_edit',Session::get('role_menu_action'))){ ?>
                                                    <a class="btn btn-xs btn-default m-r-5 edit-btn" href="<?php echo e(route('admin.admin.edit', ['id'=>$v->id])); ?>" data-toggle="tooltip" data-original-title="编辑"><i class="mdi mdi-pencil"></i></a>
                                                    <?php } ?>
                                                    <?php if(in_array('admin_delete',Session::get('role_menu_action'))){ ?>
                                                    <a class="btn btn-xs btn-default m-r-5 del-btn" data-href="<?php echo e(route('admin.admin.delete')); ?>" data-confirm="确定删除管理员?" data-id="<?php echo e($v->id); ?>" title="" data-toggle="tooltip" data-original-title="删除"><i class="mdi mdi-delete"></i></a>
                                                    <?php } ?>
                                                <?php endif; ?>
                                                <?php if(in_array('admin_reset_pwd',Session::get('role_menu_action'))){ ?>
                                                <a class="btn btn-xs btn-default m-r-5 resetpwd" href="javascript:void(0)" data-href="<?php echo e(route('admin.admin.reset_pwd', ['id'=>$v->id])); ?>" data-toggle="tooltip" title="" data-original-title="重置密码">重置密码</a>
                                                <?php } ?>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                                <tr>
                                    <td colspan="8" style="text-align: center;color:#ff0000;">查询数据不存在！</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <?php echo $pager; ?>

                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<script>
    $('.resetpwd').click(function(){
        var url = $(this).attr('data-href');
        $.ajax({
            url: url,
            type: 'get',
            success:function(shtml)
            {
                layer.open({
                    type: 1,
                    title: '重置密码',
                    area: ['600px', '500px'],
                    shadeClose: true, //点击遮罩关闭
                    content: shtml
                });
            }
        })
    })
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.public.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\phpstudy_8.1\WWW\my_admin\resources\views/admin/admin/index.blade.php ENDPATH**/ ?>